﻿﻿
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
	String basePath = "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="/">
    <!-- 下拉框 -->
    <link rel="stylesheet" href="static/ace/css/chosen.css"/>
    <!-- jsp文件头和头部 -->
    <%@ include file="../index/top.jsp" %>
    <!-- 日期框 -->
    <link rel="stylesheet" href="static/ace/css/datepicker.css"/>
    <link rel="stylesheet" href="static/styles/base.css"/>
</head>
<body class="no-skin">

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">

                        <!-- 检索  -->
                        <form action="count/getSanNongRewardlistPage.do" method="post" name="goodsForm" id="goodsForm">
                            <table style="margin-top:5px;">
                                <tr>
                                    <td class="zdyTime" style="padding-left:5px;"> <input class="span10 date-picker" name="LongTerm" id="LongTerm" value="${pd.LongTerm}" type="text" style="width:88px;" placeholder="选择月份"  title="选择月份"/></td>
                                    <td class="center" style="padding-left:5px;"> 自定义时间 </td>
                                    
                                    <td class="input-daterange"> 
                                    	<div class="dib vm pl5"><input class="span10 date-picker" name="startTime" id="startTime" value="${pd.startTime}" type="text"  style="width:88px;" placeholder="选择日期" title="选择日期"/></div>
                                    	<div class="dib vm pl5">至</div>
                                    	<div class="dib vm pl5"><input class="span10 date-picker" name="endTime" id="endTime" value="${pd.endTime}" type="text" style="width:88px;" placeholder="选择日期" title="选择日期"/></div>
                                    </td>
                                    <c:if test="${QX.cha == 1 }">
										<td style="vertical-align: top; padding-left: 2px;"><a
											class="btn btn-light btn-xs" onclick="searchs();" title="检索"><i
												id="nav-search-icon"
												class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a>
										</td>
									</c:if>
                                </tr>
                            </table>
                            <!-- 检索  -->
							<div style="padding-top:30px;">
								<span>金额：${price } (元)</span>
							</div>
                            <table id="simple-table" class="table table-striped table-bordered table-hover"
                                   style="margin-top:5px;">
                                <thead>
                                <tr>
                                    <th class="center" style="width:50px;">排序</th>
                                    <th class="center">支付编码</th>
                                    <th class="center">用户昵称</th>
                                    <th class="center">手机</th>
                                    <th class="center">奖励类型</th>
                                    <th class="center">奖励描述</th>
                                    <th class="center">金额</th>
                                    <th class="center">购买用户昵称</th>
                                    <th class="center">购买用户手机号</th>
                                    <th class="center">商品</th>
                                    <th class="center">销售金额</th>
                                    <th class="center">支付时间</th>
                                </tr>
                                </thead>

                                <tbody id="goodlist">

                                <!-- 开始循环 -->
                                <c:choose>
                                    <c:when test="${not empty rewardList}">
                                        <c:if test="${QX.cha == 1 }">
                                            <c:forEach items="${rewardList}" var="reward" varStatus="vs">
                                                <tr>
                                                    <td class='center' style="width: 30px;">${vs.index+1}</td>
                                                    <td class="center">${reward.code }</td>
                                                    <td class="center">${reward.activityPhone }</td>
                                                    <td class="center">${reward.activityUserName }</td>
                                                    <td class="center">
                                                    <c:if test="${reward.type!=null}">
	                                                    <c:if test="${reward.type=='00'}">
	                                                    	<c:if test="${reward.sub_type!=null}">
																<c:if test="${reward.sub_type=='00'}">
																		普通消费
																</c:if>
																<c:if test="${reward.sub_type=='01'}">
																		复投消费
																</c:if>
															</c:if>
															<c:if test="${reward.sub_type==null}">
																/
															</c:if>
														</c:if>
														<c:if test="${reward.type=='02'}">
	                                                    	<c:if test="${reward.sub_type!=null}">
																<c:if test="${reward.sub_type=='00'}">
																		二级返利
																</c:if>
																<c:if test="${reward.sub_type=='01'}">
																		直推奖
																</c:if>
																<c:if test="${reward.sub_type=='01'}">
																		间推奖
																</c:if>
																<c:if test="${reward.sub_type=='01'}">
																		见点奖
																</c:if>
															</c:if>
															<c:if test="${reward.sub_type==null}">
																/
															</c:if>
														</c:if>
                                                    </c:if>
                                                    <c:if test="${reward.type==null}">/</c:if>
                                                    </td>
                                                    <td class="center">${reward.remark }</td>
                                                    <td class="center">${reward.payPrice }</td> 
                                                    <td class="center">${reward.buyName }</td> 
                                                    <td class="center">${reward.buyPhone }</td> 
                                                    <td class="center">${reward.title }</td>
                                                    <td class="center">${reward.realPrice }</td>
                                                    <td class="center">${reward.pay_time }</td>
                                                </tr>
                                            </c:forEach>
                                        </c:if>
                                        <c:if test="${QX.cha == 0 }">
                                            <tr>
                                                <td colspan="13" class="center">您无权查看</td>
                                            </tr>
                                        </c:if>
                                    </c:when>
                                    <c:otherwise>
                                        <tr class="main_info">
                                            <td colspan="13" class="center">没有相关数据</td>
                                        </tr>
                                    </c:otherwise>
                                </c:choose>
                                </tbody>
                            </table>
                            <div class="page-header position-relative">
                                <table style="width:100%;">
                                    <tr>
                                        <td style="vertical-align:top;">
                                            <div class="pagination"
                                                 style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </form>

                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->

    <!-- 返回顶部 -->
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>

</div>
<!-- /.main-container -->

<!-- basic scripts -->
<!-- 页面底部js¨ -->
<%@ include file="../index/foot.jsp" %>
<!-- 删除时确认窗口 -->
<script src="static/ace/js/bootbox.js"></script>
<!-- ace scripts -->
<script src="static/ace/js/ace/ace.js"></script>
<!-- 日期框 -->
<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
<!-- 下拉框 -->
<script src="static/ace/js/chosen.jquery.js"></script>
<!--提示框-->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
</body>

<script type="text/javascript">
    $(top.hangge());
    
    
    var spanDateFormat = 'yyyy-mm-dd';
    $('.input-daterange').datepicker({
    	  autoclose: true,
    	  format: "yyyy-mm-dd",
    	  maxViewMode: 0,
    	});
    
    $(".zdyTime input").datepicker({
    	 format: "yyyy-mm",
    	 startView: 1,
    	 minViewMode: 1,
    	 maxViewMode: 2,
    	 language: "zh-CN",
    	 autoclose: true
	});
    
    //检索
    function searchs() {
    	var startTime = $("#startTime").val();//开始时间
    	var endTime = $("#endTime").val();//结束时间
    	if(startTime!="" && endTime!=""){
    		$("#LongTerm").val('');
    	}
        top.jzts();
        $("#goodsForm").submit();
    }
</script>
</html>
